/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.catalogos.prueba.business;

import com.catalogos.prueba.dao.ConsultasDAO;
import com.catalogos.prueba.entities.AtributoCatalogo;
import com.catalogos.prueba.entities.Catalogo;
import com.catalogos.prueba.entities.ValorCatalogo;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author 874836
 */
public class CatalogoService {

   private ConsultasDAO con;

    public List<Catalogo> getCatalogos() {
        List<Catalogo> listCat = new ArrayList<Catalogo>();
        con = new ConsultasDAO();
        try {
            listCat = con.getCatalogo();
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(e.getMessage());
        }
        return listCat;
    }


    public List<AtributoCatalogo> getAtributosCatalogo(int idCat) {
        List<AtributoCatalogo> lstAtributosCatalogo = new ArrayList<AtributoCatalogo>();
        con = new ConsultasDAO();
        try {
            lstAtributosCatalogo = con.getAtributoCat(idCat);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(e.getMessage());
        }
        return lstAtributosCatalogo;
    }


    public List<ValorCatalogo> getValorCatalogo(int idCat){
        List<ValorCatalogo> valCat=new ArrayList<ValorCatalogo>();
        con = new ConsultasDAO();
        try {
            valCat = con.getValorCatalogo(idCat);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(e.getMessage());
        }
        return valCat;
    }

}
